use "/Users/dbroock/Documents/Docs/research/In Progress/Email In Out Exp/DATA/FOR AJPS/broockman_intrinsic_motivation.dta", clearset more offtab code_sometab leg_black*TABLE 2reg code_some treat_outestimates store t2c1gen treatXblack = treat_out * leg_blackreg code_some treat_out treatXblack leg_blackestimates store t2c2reg code_some treat_out treatXblack leg_black nonblacknonwhite leg_democrat leg_senator south blackpercent black_medianhh white_medianhh statessquire totalpop urbanpercentestimates store t2c3logit code_some treat_out treatXblack leg_black nonblacknonwhite leg_democrat leg_senator south blackpercent black_medianhh white_medianhh statessquire totalpop urbanpercentestimates store t2c4cem medianhhincom blackpercent leg_democrat(#2), tr(leg_black) sh*see http://gking.harvard.edu/files/cemStata.pdfreg code_some treat_out treatXblack leg_black nonblacknonwhite leg_democrat leg_senator south blackpercent black_medianhh white_medianhh statessquire totalpop urbanpercent [iweight=cem_weights]estimates store t2c5*TABLE 3*Test for het effects by distance among blacksxi: reg code_some i.treat_out*dist_from_dist_to_out if leg_blackestimates store t3c1*This unit is hundreds of milesreg code_some treatXblack leg_black treat_out if dist_from_dist_to_out > 2estimates store t3c2#delimit;gen obamaunder45 = leg_state == "OK" |leg_state == "WY" | leg_state == "UT" | leg_state == "ID" |leg_state == "AL" | leg_state == "AK" | leg_state == "LA" |leg_state == "KY" | leg_state == "TN" | leg_state == "KS" |leg_state == "NE" | leg_state == "MS" | leg_state == "WV" |leg_state == "TX" | leg_state == "SC" | leg_state == "ND" | leg_state == "SD";#delimit crreg code_some treat_out treatXblack leg_black if obamaunder45estimates store t3c3gen demXtreat = treat_out * leg_democratreg code_some treat_out leg_democrat demXtreat if leg_black == 0estimates store t3c4gen leg_female = leg_gender == "F"xi: reg code_some i.treat_out*leg_female if leg_black == 0estimates store t3c5bysort leg_state: egen numblacklegs = sum(leg_black)gen one = 1bysort leg_state: egen numlegs = sum(one)drop onegen perc_legs_black = numblacklegs/numlegs * 100xi: reg code_some treat_out leg_black treatXblack i.leg_black*perc_legs_black i.treat_out*perc_legs_black i.treatXblack*perc_legs_blackestimates store t3c6/*Table SI1 - Randomization Check*/reg code_some treat_out treatXblack leg_black [iweight=cem_weights]reg code_some treat_out treatXblack leg_black nonblacknonwhite leg_democrat leg_senator south blackpercent black_medianhh white_medianhh statessquire totalpop urbanpercent [iweight=cem_weights]reg treat_out leg_black leg_senator leg_democrat blackpercent black_median white_median statessquire totalpop urbanpercentestimates store si1c1/*Table SI2 - Treatment Effects w/ Helpful*/reg helpful treat_outestimates store si2c1reg helpful treat_out treatXblack leg_blackestimates store si2c2reg helpful treat_out treatXblack leg_black nonblacknonwhite leg_democrat leg_senator south blackpercent black_medianhh white_medianhh statessquire totalpop urbanpercentestimates store si2c3logit helpful treat_out treatXblack leg_black nonblacknonwhite leg_democrat leg_senator south blackpercent black_medianhh white_medianhh statessquire totalpop urbanpercentestimates store si2c4reg helpful treat_out treatXblack leg_black nonblacknonwhite leg_democrat leg_senator south blackpercent black_medianhh white_medianhh statessquire totalpop urbanpercent [iweight=cem_weights]estimates store si2c5/*Table SI3 - Heterogenous Treatment Effects*/gen squireXtreat = treat_out * statessquirereg code_some treat_out treatXblack squireXtreat leg_black nonblacknonwhite leg_democrat leg_senator south blackpercent black_medianhh white_medianhh statessquire totalpop urbanpercentestimates store si3c1gen blackpercentXtreat = treat_out * blackpercentreg code_some treat_out treatXblack blackpercentXtreat leg_black nonblacknonwhite leg_democrat leg_senator south blackpercent black_medianhh white_medianhh statessquire totalpop urbanpercentestimates store si3c2gen treatXsouth = treat_out * southreg code_some treat_out treatXblack treatXsouth leg_black nonblacknonwhite leg_democrat leg_senator south blackpercent black_medianhh white_medianhh statessquire totalpop urbanpercentestimates store si3c3gen treatXmhhb = treat_out * black_mediangen treatXmhhw = treat_out * white_medianreg code_some treat_out treatXblack treatXmhhb treatXmhhw leg_black nonblacknonwhite leg_democrat leg_senator south blackpercent black_medianhh white_medianhh statessquire totalpop urbanpercentestimates store si3c4